package me.jessyan.mvparms.demo.mvp.ui.adapter;

import android.view.View;

import com.jess.arms.base.BaseHolder;
import com.jess.arms.base.DefaultAdapter;

import java.util.List;

import me.jessyan.mvparms.demo.R;
import me.jessyan.mvparms.demo.mvp.ui.holder.MyIntegralRecordHolder;
import me.jessyan.mvparms.demo.mvp.ui.holder.MyInteralRecordMothHoleder;

/**
 * @author DrChen
 * @Date 2019/3/5 0005.
 * qq:1414355045
 */
public class MyIntegralRecordAdapter  extends DefaultAdapter<Boolean>{

    public MyIntegralRecordAdapter(List<Boolean> infos) {
        super(infos,true);
    }

    @Override
    public BaseHolder<Boolean> getHolder(View v, int viewType) {
        if(viewType==1){
            return new MyInteralRecordMothHoleder(v);
        }else {

            return new MyIntegralRecordHolder(v,mInfos);
        }


    }

    @Override
    public int getItemViewType(int position) {

        return mInfos.get(position)? 1:2;

    }

    @Override
    public int getLayoutId(int viewType) {
        if(viewType==1){
            return R.layout.item_integral_record_moth;
        }else {
            return R.layout.item_integral_record;
        }


    }
}
